<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.ico">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha256-wiz7ZSCn/btzhjKDQBms9Hx4sSeUYsDrTLg7roPstac=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.css" integrity="sha256-6cQIC71/iBIYXFK+0RHAvwmjwWzkWd+r7v/BX3/vZDc=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/green/pace-theme-minimal.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"sumumm.github.io","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.19.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"fold":{"enable":true,"height":300},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="本文主要是SQLite数据库的语句相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:type" content="article">
<meta property="og:title" content="LV07-03-SQLite-语句">
<meta property="og:url" content="https://sumumm.github.io/post/6540bbef.html">
<meta property="og:site_name" content="苏木">
<meta property="og:description" content="本文主要是SQLite数据库的语句相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-07-03T13:30:26.000Z">
<meta property="article:modified_time" content="2025-06-13T16:25:57.000Z">
<meta property="article:author" content="苏木">
<meta property="article:tag" content="LV07-SQLite">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://sumumm.github.io/post/6540bbef.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://sumumm.github.io/post/6540bbef.html","path":"post/6540bbef.html","title":"LV07-03-SQLite-语句"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>LV07-03-SQLite-语句 | 苏木</title>
  








    <script src="/js/browser_tools_disable.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<!-- hexo injector head_end start --><link rel="stylesheet" href="https://unpkg.com/hexo-next-tags-plus@latest/lib/tag_plus.css" media="defer" onload="this.media='all'"><!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">苏木</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">我的学习之路</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>苏木的家</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类页<span class="badge">42</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档页<span class="badge">673</span></a></li><li class="menu-item menu-item-flink"><a href="/flink/" rel="section"><i class="fa fa-link fa-fw"></i>友人帐</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于我</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%80%E3%80%81SQLite%E8%AF%AD%E5%8F%A5%E4%B8%8E%E6%B3%A8%E9%87%8A"><span class="nav-text">一、SQLite语句与注释</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-%E8%AF%AD%E5%8F%A5%E8%AF%AD%E6%B3%95"><span class="nav-text">1. 语句语法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-%E6%B3%A8%E9%87%8A"><span class="nav-text">2. 注释</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%BA%8C%E3%80%81%E5%AD%90%E5%8F%A5"><span class="nav-text">二、子句</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-where"><span class="nav-text">1. where</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E5%AD%90%E5%8F%A5%E8%AF%B4%E6%98%8E"><span class="nav-text">1.1 子句说明</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">1.2 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-like"><span class="nav-text">2. like</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E5%AD%90%E5%8F%A5%E8%AF%B4%E6%98%8E"><span class="nav-text">2.1 子句说明</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">2.2 使用实例</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E4%B8%89%E3%80%81%E5%B8%B8%E7%94%A8%E8%AF%AD%E5%8F%A5"><span class="nav-text">三、常用语句</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#1-CREATE-TABLE"><span class="nav-text">1. CREATE TABLE</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">1.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-2-%E7%9B%B8%E5%85%B3%E5%91%BD%E4%BB%A4"><span class="nav-text">1.2 相关命令</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-2-%E6%9F%A5%E7%9C%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E7%9A%84%E8%A1%A8"><span class="nav-text">1.2 查看数据库中的表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#1-3-%E6%9F%A5%E7%9C%8B%E8%A1%A8%E4%BF%A1%E6%81%AF"><span class="nav-text">1.3 查看表信息</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#1-3-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">1.3 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-INSERT-INTO"><span class="nav-text">2. INSERT INTO</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#2-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">2.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B-1"><span class="nav-text">2.2 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-SELECT"><span class="nav-text">3. SELECT</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">3.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-%E7%9B%B8%E5%85%B3%E5%91%BD%E4%BB%A4"><span class="nav-text">3.2 相关命令</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-2-1-%E8%BE%93%E5%87%BA%E5%88%97%E6%A0%BC%E5%BC%8F"><span class="nav-text">3.2.1 输出列格式</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-2-2-%E8%BE%93%E5%87%BA%E5%88%97%E5%AE%BD%E5%BA%A6"><span class="nav-text">3.2.2 输出列宽度</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-3-%E5%88%9B%E5%BB%BA%E8%A1%A8%E6%97%B6%E7%9A%84%E4%BF%A1%E6%81%AF"><span class="nav-text">3.3 创建表时的信息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-4-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">3.4 使用实例</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-1-%E8%AE%BE%E7%BD%AE%E8%BE%93%E5%87%BA%E5%88%97%E6%A0%BC%E5%BC%8F"><span class="nav-text">3.4.1 设置输出列格式</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-2-%E6%9F%A5%E7%9C%8B%E8%A1%A8%E4%B8%AD%E6%89%80%E6%9C%89%E6%95%B0%E6%8D%AE"><span class="nav-text">3.4.2 查看表中所有数据</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-3-%E6%9F%A5%E7%9C%8B%E8%A1%A8%E4%B8%AD%E7%89%B9%E5%AE%9A%E6%95%B0%E6%8D%AE"><span class="nav-text">3.4.3 查看表中特定数据</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-4-4-%E6%9F%A5%E7%9C%8B%E8%A1%A8%E4%BF%A1%E6%81%AF"><span class="nav-text">3.4.4 查看表信息</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-UPDATE"><span class="nav-text">4. UPDATE</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#4-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">4.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">4.2 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-DELETE"><span class="nav-text">5. DELETE</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#5-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">5.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">5.2 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-DROP"><span class="nav-text">6. DROP</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#6-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">6.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#6-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">6.2 使用实例</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-ALTER"><span class="nav-text">7. ALTER</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#7-1-%E8%AF%AD%E5%8F%A5%E6%A0%BC%E5%BC%8F"><span class="nav-text">7.1 语句格式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#7-2-%E4%BD%BF%E7%94%A8%E5%AE%9E%E4%BE%8B"><span class="nav-text">7.2 使用实例</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#7-2-1-%E9%87%8D%E5%91%BD%E5%90%8D%E6%95%B0%E6%8D%AE%E8%A1%A8"><span class="nav-text">7.2.1 重命名数据表</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#7-2-2-%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E6%96%B0%E5%88%97"><span class="nav-text">7.2.2 添加一个新列</span></a></li></ol></li></ol></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="苏木"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">苏木</p>
  <div class="site-description" itemprop="description">莫道桑榆晚，为霞尚满天</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">673</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">43</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/sumumm" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;sumumm" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://sumumm.github.io/post/6540bbef.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="苏木">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="苏木">
      <meta itemprop="description" content="莫道桑榆晚，为霞尚满天">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="LV07-03-SQLite-语句 | 苏木">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          LV07-03-SQLite-语句
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-07-03 21:30:26" itemprop="dateCreated datePublished" datetime="2023-07-03T21:30:26+08:00">2023-07-03</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">嵌入式开发</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/" itemprop="url" rel="index"><span itemprop="name">01HQ课程体系</span></a>
        </span>
          ，
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E5%B5%8C%E5%85%A5%E5%BC%8F%E5%BC%80%E5%8F%91/01HQ%E8%AF%BE%E7%A8%8B%E4%BD%93%E7%B3%BB/LV07-SQLite/" itemprop="url" rel="index"><span itemprop="name">LV07-SQLite</span></a>
        </span>
    </span>

  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>5k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>18 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><p>本文主要是<code>SQLite</code>数据库的语句相关笔记，若笔记中有错误或者不合适的地方，欢迎批评指正😃。</p>
<span id="more"></span>

<!-- Photo: none -->

<details class="folding-tag" blue><summary> 点击查看使用工具及版本 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center" width=150px>Windows</td>        <td align="left">windows11</td>    </tr>    <tr>        <td align="center">Ubuntu</td>        <td align="left">Ubuntu16.04的64位版本</td>      </tr>    <tr>        <td align="center">VMware® Workstation 16 Pro</td>        <td align="left">16.2.3 build-19376536</td>      </tr>    <tr>        <td align="center">SecureCRT</td>        <td align="left">Version 8.7.2 (x64 build 2214)   -   正式版-2020年5月14日</td>      </tr>    <tr>        <td align="center">开发板</td>        <td align="left">正点原子 i.MX6ULL Linux阿尔法开发板</td>      </tr>    <tr>        <td align="center">uboot</td>        <td align="left">NXP官方提供的uboot，NXP提供的版本为uboot-imx-rel_imx_4.1.15_2.1.0_ga(使用的uboot版本为U-Boot 2016.03)</td>      </tr>    <tr>        <td align="center">linux内核</td>        <td align="left">linux-4.15(NXP官方提供)</td>      </tr>    <tr>        <td align="center">STM32开发板</td>        <td align="left">正点原子战舰V3(STM32F103ZET6)</td>      </tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看本文参考资料 </summary>
              <div class='content'>
              <table>    <tr><td align="center">参考方向  </td><td align="center">参考原文</td></tr>    <tr><td align="left">SQLite官网</td><td align="left"><a href="https://www.sqlite.org/index.html" target="_blank">SQLite Home Page <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">SQLite中文网</td><td align="left"><a href="https://www.sqlite.net.cn/" target="_blank">SQLite 中文网 <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">SQLite 基础教程</td><td align="left"><a href="https://www.php.cn/manual/view/19335.html" target="_blank">SQLite参考手册 - 在线原生手册 <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">菜鸟教程</td><td align="left"><a href="https://www.runoob.com/sqlite/sqlite-tutorial.html" target="_blank">SQLite 教程 <i class="fa fa-external-link-alt"></i> </a></td></tr>    <tr><td align="left">易百教程</td><td align="left"><a href="https://www.yiibai.com/sqlite" target="_blank">SQLite 教程 <i class="fa fa-external-link-alt"></i> </a></td></tr></table>
              </div>
            </details>

<details class="folding-tag" blue><summary> 点击查看相关文件下载 </summary>
              <div class='content'>
              <table>    <tr>        <td align="center">---</td>        <td align="left">--- <a href="" target="_blank">  <i class="fa fa-external-link-alt"></i></a></td>      </tr></table>
              </div>
            </details>

<p>下边介绍语句的时候，可能会用到<code>SQLite</code>的一些命令，这些命令会在后边的笔记中进行说明，这里就先知道怎么用就好啦。</p>
<h1 id="一、SQLite语句与注释"><a href="#一、SQLite语句与注释" class="headerlink" title="一、SQLite语句与注释"></a><font size=3>一、<code>SQLite</code>语句与注释</font></h1><h2 id="1-语句语法"><a href="#1-语句语法" class="headerlink" title="1. 语句语法"></a><font size=3>1. 语句语法</font></h2><p>在<code>SQLite</code>中的语句，严格意义上来说，更像是命令，<code>SQLite</code>中的语句有以下特点：</p>
<ul>
<li>都是以关键字(如：<code>SELECT</code>，<code>INSERT</code>，<code>UPDATE</code>，<code>DELETE</code>，<code>ALTER</code>，<code>DROP</code>等)开始的。</li>
<li>语句<strong>可以多行书写</strong>，并且所有的语句都以分号（<code>;</code>）结尾。</li>
<li><code>SQLite</code> 是<strong>不区分大小写</strong>，但是需要注意的是，也有一些命令是大小写敏感的，比如 <code>GLOB</code>和 <code>glob</code>在 <code>SQLite</code> 的语句中有不同的含义。</li>
</ul>
<p>我看网上的大部分教程都是全部写的大写，但是我上的网课中，老师都是用的小写，也都没啥问题，那些个特殊的，遇到的时候再总结就好啦。（所以，后边在写笔记的时候，记录语句格式的时候用的都是大写，但是写实例的时候我自己就都用的小写了）</p>
<h2 id="2-注释"><a href="#2-注释" class="headerlink" title="2. 注释"></a><font size=3>2. 注释</font></h2><p><code>SQLite</code>的语句是可以有注释的，它的注释是连续两个<code>-</code>字符（<code>ASCII 0x2d</code>）开始，并扩展至下一个换行符（<code>ASCII 0x0a</code>）或直到输入结束，以先到者为准。也可以使用 <code>C</code> 风格的注释，以 <code>/*</code> 开始，并扩展至下一个 <code>*/</code>字符对或直到输入结束，以先到者为准。</p>
<p><strong>【注意】</strong></p>
<p>（1）注释不能嵌套。</p>
<p>（2）<code>SQLite</code>的注释可以跨越多行。</p>
<h1 id="二、子句"><a href="#二、子句" class="headerlink" title="二、子句"></a><font size=3>二、子句</font></h1><p>这里还是先学习一下子句，毕竟后边很多命令都会与子句相结合使用。</p>
<h2 id="1-where"><a href="#1-where" class="headerlink" title="1. where"></a><font size=3>1. where</font></h2><h3 id="1-1-子句说明"><a href="#1-1-子句说明" class="headerlink" title="1.1 子句说明"></a><font size=3>1.1 子句说明</font></h3><p><code>SQLite</code>的 <code>WHERE</code>子句用于指定从一个表或多个表中获取数据的条件。它通常与<code>SELECT</code>，<code>UPDATE</code>和<code>DELETE</code>语句一起使用来，以便于对特定的对象进行相关操作。以<code>SELECT</code>为例，一般语法格式如下：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">-- 多行语句</span><br><span class="line">SELECT column1, column2, columnN   </span><br><span class="line">FROM table_name  </span><br><span class="line">WHERE [condition];</span><br><span class="line"></span><br><span class="line">-- 单行语句</span><br><span class="line">SELECT column1, column2, columnN FROM table_name WHERE [condition];</span><br></pre></td></tr></table></figure>

<p>实例这里就不再写了，后边学习<code>SELECT</code>、<code>UPDATE</code>等语句的时候会加上关于<code>WHERE</code>的使用实例。</p>
<h3 id="1-2-使用实例"><a href="#1-2-使用实例" class="headerlink" title="1.2 使用实例"></a><font size=3>1.2 使用实例</font></h3><p>暂无</p>
<h2 id="2-like"><a href="#2-like" class="headerlink" title="2. like"></a><font size=3>2. like</font></h2><h3 id="2-1-子句说明"><a href="#2-1-子句说明" class="headerlink" title="2.1 子句说明"></a><font size=3>2.1 子句说明</font></h3><p><code>SQLite</code>中的<code>LIKE</code>运算符用于使用通配符将文本值与模式进行匹配。 在搜索表达式与模式表达式匹配的情况下，<code>LIKE</code>运算符将返回真（<code>true</code>），即：<code>1</code>。这里有两个通配符与 <code>LIKE</code> 子句一起使用：</p>
<ul>
<li>百分号 （<code>%</code>），代表零个、一个或多个数字或字符。</li>
<li>下划线 （<code>_</code>），代表一个单一的数字或字符。</li>
</ul>
<p>以<code>SELECT</code>为例，一般语法格式如下：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">SELECT column_list FROM table_name WHERE column LIKE &#x27;XXX%&#x27;;</span><br><span class="line">-- or </span><br><span class="line">SELECT column_list FROM table_name WHERE column LIKE &#x27;%XXX%&#x27;;</span><br><span class="line">-- or</span><br><span class="line">SELECT column_list FROM table_name WHERE column LIKE &#x27;XXX_&#x27;;</span><br><span class="line">-- or</span><br><span class="line">SELECT column_list FROM table_name WHERE column LIKE &#x27;_XXX&#x27;;</span><br><span class="line">-- or</span><br><span class="line">SELECT column_list FROM table_name WHERE column LIKE &#x27;_XXX_&#x27;;</span><br></pre></td></tr></table></figure>

<p>我们可以使用 <code>AND</code> 或 <code>OR</code> 运算符来结合 <code>N</code> 个数量的条件。在这里，<code>XXX</code> 可以是任何数字或字符串值。</p>
<p><strong>【注意】</strong></p>
<p>（1）一般来说<code>LIKE</code>会与<code>WHERE</code>连用。</p>
<p>（2）这些符号可以被组合使用。</p>
<h3 id="2-2-使用实例"><a href="#2-2-使用实例" class="headerlink" title="2.2 使用实例"></a><font size=3>2.2 使用实例</font></h3><table>
    <tr><td align="center">语句</td><td align="center">描述</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '200%'</td><td align="left">查找以 200 开头的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '%200%'</td><td align="left">查找任意位置包含 200 的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '_00%'</td><td align="left">查找第二位和第三位为 00 的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '2_%_%'</td><td align="left">查找以 2 开头，且长度至少为 3 个字符的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '%2'</td><td align="left">查找以 2 结尾的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '_2%3'</td><td align="left">查找第二位为 2，且以 3 结尾的任意值</td></tr>
    <tr><td align="left">WHERE SALARY LIKE '2___3'</td><td align="left">查找长度为 5 位数，且以 2 开头以 3 结尾的任意值</td></tr>
</table>

<h1 id="三、常用语句"><a href="#三、常用语句" class="headerlink" title="三、常用语句"></a><font size=3>三、常用语句</font></h1><h2 id="1-CREATE-TABLE"><a href="#1-CREATE-TABLE" class="headerlink" title="1. CREATE TABLE"></a><font size=3>1. <code>CREATE TABLE</code></font></h2><h3 id="1-1-语句格式"><a href="#1-1-语句格式" class="headerlink" title="1.1 语句格式"></a><font size=3>1.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">CREATE TABLE table_name(</span><br><span class="line">   column1 datatype  PRIMARY KEY(one or more columns),</span><br><span class="line">   column2 datatype,</span><br><span class="line">   column3 datatype,</span><br><span class="line">   .....</span><br><span class="line">   columnN datatype,</span><br><span class="line">);</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于在一个数据库中创建一个数据表，并添加表头。这个表就类似于<code>Windows</code>下的<code>Excel</code>中的工作簿下边的一张工作表一样，一个工作簿可以有多张工作表，一个数据库也可以有多个数据表。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>CREATE</code>：这是一个关键字，表示创建一个数据表。</li>
<li><code>table_name</code>：数据表的名称。</li>
<li><code>columnN</code>：这表示数据表中的表头名称。</li>
<li><code>datatype</code>：：表示这列数据的存储类。</li>
<li><code>PRIMARY KEY</code>：主关键字(<code>primary key</code>)，它是表中的一个或多个字段，它的值用于<strong>唯一</strong>的标识表中的某一条记录。在两个表的关系中，主关键字用来在一个表中引用来自于另一个表中的特定记录。主关键字是<strong>一种唯一关键字</strong>，它是表定义的一部分。一个表的主键可以由多个关键字共同组成，并且主关键字的列不能包含空值，另外主关键字是可选的。这个主键后边会再专门介绍一次，因为有个作业用到了这个主关键字。</li>
</ul>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="1-2-相关命令"><a href="#1-2-相关命令" class="headerlink" title="1.2 相关命令"></a><font size=3>1.2 相关命令</font></h3><h4 id="1-2-查看数据库中的表"><a href="#1-2-查看数据库中的表" class="headerlink" title="1.2 查看数据库中的表"></a><font size=3>1.2 查看数据库中的表</font></h4><p>怎么知道当前数据库下有哪些表呢，我们可以使用下边的命令：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.tables</span><br></pre></td></tr></table></figure>

<h4 id="1-3-查看表信息"><a href="#1-3-查看表信息" class="headerlink" title="1.3 查看表信息"></a><font size=3>1.3 查看表信息</font></h4><p>我们可以通过下边的命令来查看创建表时完整的信息：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.schema</span><br></pre></td></tr></table></figure>



<h3 id="1-3-使用实例"><a href="#1-3-使用实例" class="headerlink" title="1.3 使用实例"></a><font size=3>1.3 使用实例</font></h3><p>我们在一个创建好的数据库中创建一个数据表，可以在<code>SQLite</code>命令提示符后边输入以下语句：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">-- 多行语句</span><br><span class="line">create table stuinfo(</span><br><span class="line">     id    integer primary key, </span><br><span class="line">     name  text, </span><br><span class="line">     age   integer, </span><br><span class="line">     score float</span><br><span class="line">);</span><br><span class="line"></span><br><span class="line">-- 单行语句</span><br><span class="line">create table stuinfo(id integer primary key, name text, age integer, score float);</span><br></pre></td></tr></table></figure>

<p>为了确认我们是否创建成功，我们需要知道在<code>SQLite</code>命令提示符后边输入以下命令就可以查看当前数据库中的所有数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .tables -- 后边会再具体说明这种类型的命令如何使用</span><br></pre></td></tr></table></figure>

<p>然后我们就会看到如下信息输出：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">stuinfo</span><br></pre></td></tr></table></figure>

<p>这说明，我们创建的<code>stuinfo</code>表已经创建成功了。</p>
<p>有时候我们需要查看表的完整信息，我们可以在<code>SQLite3</code>中使用以下命令来查看：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .schema stuinfo -- 后边会再具体说明这种类型的命令如何使用</span><br></pre></td></tr></table></figure>

<p>然后我们会看到有如下信息输出：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">CREATE TABLE stuinfo(id integer primary key, name text, age integer, score float);</span><br></pre></td></tr></table></figure>

<p>这个时候会显示我们创建表时使用的语句，我们使用的小写关键字此时都会变成大写关键字。</p>
<h2 id="2-INSERT-INTO"><a href="#2-INSERT-INTO" class="headerlink" title="2. INSERT INTO"></a><font size=3>2. <code>INSERT INTO</code></font></h2><h3 id="2-1-语句格式"><a href="#2-1-语句格式" class="headerlink" title="2.1 语句格式"></a><font size=3>2.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">INSERT INTO table_name(column1, column2, ..., columnN) VALUES(value1, value2, ..., valueN);</span><br><span class="line"></span><br><span class="line">-- or(为所有列添加值)</span><br><span class="line"></span><br><span class="line">INSERT INTO table_name VALUES (value1, value2, value3, ..., valueN);</span><br><span class="line"></span><br><span class="line">-- 用一个表填充另一个表</span><br><span class="line">INSERT INTO first_table_name [(column1, column2, ..., columnN)] </span><br><span class="line">   SELECT column1, column2, ..., columnN </span><br><span class="line">   FROM second_table_name</span><br><span class="line">   [WHERE condition];</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于在一个数据表中添加一条数据记录。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>INSERT</code>：这是一个关键字，表示插入数据。</li>
<li><code>table_name</code>：记录要插入的数据表的名称。</li>
<li><code>columnN</code>：表示数据表中的表头名称，就是我们要插入到哪一列。</li>
<li><code>valueN</code>：表示要插入列的数据的值，当我们要插入的数据个数与列数一一对应的时候，上边的<code>columnN</code>是可以省略掉的，但要确保值的顺序与列在表中的顺序一致。若是要添加的值少于创建表时的列数，我们就需要加上<code>columN</code>，表示我们想要把这条记录的这个数据插入在哪一列。</li>
</ul>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="2-2-使用实例-1"><a href="#2-2-使用实例-1" class="headerlink" title="2.2 使用实例"></a><font size=3>2.2 使用实例</font></h3><p>我们在一个创建好的数据表中插入一条数据记录，可以在<code>SQLite</code>命令提示符后边输入以下语句：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">insert into stuinfo values(1001, &#x27;fanhua&#x27;, 18, 80);</span><br><span class="line">insert into stuinfo (id, name, score) values(1002, &#x27;qidaink&#x27;, 90);</span><br><span class="line"></span><br><span class="line">insert into stuinfo values(1001, &#x27;fanhua&#x27;, 18); -- 会报错</span><br></pre></td></tr></table></figure>

<p>当我们执行前两条语句的时候，是没有任何问题的，执行第三条时，会报以下错误：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Parse error: table stuinfo has 4 columns but 3 values were supplied</span><br></pre></td></tr></table></figure>

<p>这就是因为我们并未指定数据要插入到哪一列，而数据的个数又少于了创建表时创建的列数了。那我们插入数据是否插入成功了呢？我们这个时候就需要使用<code>select</code>来显示记录啦。</p>
<h2 id="3-SELECT"><a href="#3-SELECT" class="headerlink" title="3. SELECT"></a><font size=3>3. <code>SELECT</code></font></h2><h3 id="3-1-语句格式"><a href="#3-1-语句格式" class="headerlink" title="3.1 语句格式"></a><font size=3>3.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">SELECT column1, column2, columnN FROM table_name; -- 查看指定列数据</span><br><span class="line">SELECT * FROM table_name;                         -- 查看全部列数据</span><br><span class="line"></span><br><span class="line">-- 带WHERE子句的格式</span><br><span class="line"></span><br><span class="line">SELECT column1, column2, columnN FROM table_name WHERE [condition];;</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于从 <code>SQLite</code> 数据库表中获取数据，以结果表的形式返回数据，这些结果表也被称为结果集。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>SELECT</code>：这是一个关键字，表示获取数据。</li>
<li><code>columnN</code>：表示数据表中的表头名称，就是我们获取哪些列的数据，需要获取所有列数据的时候，可以使用<code>*</code>代替。</li>
<li><code>table_name</code>：记录要获取数据所在数据表的名称。</li>
</ul>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="3-2-相关命令"><a href="#3-2-相关命令" class="headerlink" title="3.2 相关命令"></a><font size=3>3.2 相关命令</font></h3><h4 id="3-2-1-输出列格式"><a href="#3-2-1-输出列格式" class="headerlink" title="3.2.1 输出列格式"></a><font size=3>3.2.1 输出列格式</font></h4><p>为了后边使用<code>SELECT</code>语句显示的数据更加直观，我们可以使用<code>SELECT</code>语句之前使用以下<code>SQLite</code>命令来设置输出列的格式：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">.head on</span><br><span class="line">.mode column</span><br></pre></td></tr></table></figure>

<h4 id="3-2-2-输出列宽度"><a href="#3-2-2-输出列宽度" class="headerlink" title="3.2.2 输出列宽度"></a><font size=3>3.2.2 输出列宽度</font></h4><p>有的时候可能会因为显示宽度不够而导致有些比较长的数据在显示的时候被截断，我们可以使用以下命令来设置输出列的宽度：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">.width num1, num2, ... -- 设置第一列的宽度为 num1，第二列的宽度为 num2, ...</span><br></pre></td></tr></table></figure>

<h3 id="3-3-创建表时的信息"><a href="#3-3-创建表时的信息" class="headerlink" title="3.3 创建表时的信息"></a><font size=3>3.3 创建表时的信息</font></h3><p>创建表的时候，我们查看表的完整信息是通过<code>.schema</code>命令来查看，由于<strong>点命令</strong>（后边再说）只在 <code>SQLite</code> 提示符中可用，所以当我们进行带有 <code>SQLite</code> 的编程时，我们可以使用下面的带有<code>sqlite_master</code>表的 <code>SELECT</code> 语句来列出所有在数据库中创建的表以及表的完整信息：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">SELECT tbl_name  FROM sqlite_master WHERE type = &#x27;table&#x27;; -- 列出数据库中所有表</span><br><span class="line">SELECT sql FROM sqlite_master WHERE type = &#x27;table&#x27; AND tbl_name = &#x27;table_name&#x27;; -- 列出数据库中指定表的完整信息</span><br></pre></td></tr></table></figure>

<h3 id="3-4-使用实例"><a href="#3-4-使用实例" class="headerlink" title="3.4 使用实例"></a><font size=3>3.4 使用实例</font></h3><h4 id="3-4-1-设置输出列格式"><a href="#3-4-1-设置输出列格式" class="headerlink" title="3.4.1 设置输出列格式"></a><font size=3>3.4.1 设置输出列格式</font></h4><p>在使用<code>SELECT</code>之前，我们先来设置一下输出格式：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .head on</span><br><span class="line">sqlite&gt; .mode column</span><br></pre></td></tr></table></figure>

<h4 id="3-4-2-查看表中所有数据"><a href="#3-4-2-查看表中所有数据" class="headerlink" title="3.4.2 查看表中所有数据"></a><font size=3>3.4.2 查看表中所有数据</font></h4><p>我们在一个上边已经插入了几条数据记录，可以在<code>SQLite</code>命令提示符后边输入以下语句：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; select * from stuinfo;</span><br></pre></td></tr></table></figure>

<p>然后我们便会看到以下信息显示了：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score     </span><br><span class="line">----------  ----------  ----------  ----------</span><br><span class="line">1001        fanhua      18          80.0      </span><br><span class="line">1002        qidaink                 90.0 </span><br></pre></td></tr></table></figure>

<h4 id="3-4-3-查看表中特定数据"><a href="#3-4-3-查看表中特定数据" class="headerlink" title="3.4.3 查看表中特定数据"></a><font size=3>3.4.3 查看表中特定数据</font></h4><p>在<code>SQLite</code>命令提示符后边输入以下语句：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; select * from stuinfo where name=&quot;fanhua&quot;;</span><br></pre></td></tr></table></figure>

<p>然后我们便会看到以下信息显示了：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score     </span><br><span class="line">----------  ----------  ----------  ----------</span><br><span class="line">1001        fanhua      18          80.0 </span><br></pre></td></tr></table></figure>

<h4 id="3-4-4-查看表信息"><a href="#3-4-4-查看表信息" class="headerlink" title="3.4.4 查看表信息"></a><font size=3>3.4.4 查看表信息</font></h4><p>我们再创建一个数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; create table test(name text, age integer);</span><br></pre></td></tr></table></figure>

<p>我们在<code>SQLite</code>命令提示符中输入以下语句来查看所有创建的表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; select tbl_name  from sqlite_master where type = &#x27;table&#x27;;</span><br></pre></td></tr></table></figure>

<p>然后我们会看到以下输出：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">tbl_name  </span><br><span class="line">----------</span><br><span class="line">stuinfo   </span><br><span class="line">test </span><br></pre></td></tr></table></figure>

<p>接下来我们输入以下命令来查看指定表的完整信息：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; select sql from sqlite_master where type = &#x27;table&#x27; and tbl_name = &#x27;stuinfo&#x27;;</span><br></pre></td></tr></table></figure>

<p>然后我们会看到以下输出：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">sql                                                                              </span><br><span class="line">---------------------------------------------------------------------------------</span><br><span class="line">CREATE TABLE stuinfo(id integer primary key, name text, age integer, score float)</span><br></pre></td></tr></table></figure>

<h2 id="4-UPDATE"><a href="#4-UPDATE" class="headerlink" title="4. UPDATE"></a><font size=3>4. <code>UPDATE</code></font></h2><h3 id="4-1-语句格式"><a href="#4-1-语句格式" class="headerlink" title="4.1 语句格式"></a><font size=3>4.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">UPDATE table_name</span><br><span class="line">SET column1 = value1, column2 = value2...., columnN = valueN</span><br><span class="line">WHERE [condition];</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于从 <code>SQLite</code> 数据库表中更新某一列的数据，可以使用带有 <code>WHERE</code> 子句（这它是一种条件判断，意思就是满足某种条件时再执行这条语句）的 <code>UPDATE</code> 查询来更新选定行，否则所有的行都会被更新。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>UPDATE</code>：这是一个关键字，表示更新数据。</li>
<li><code>table_name</code>：记录要更新数据所在数据表的名称。</li>
<li><code>columnN</code>：表示数据表中的表头名称，就是我们要更新哪些列的数据。</li>
<li><code>valueN</code>：表示需要更新的列的数据的新值。</li>
<li><code>WHERE</code>：是<code>SQLite</code>的子句，用于指定从一个表或多个表中获取数据的条件。</li>
<li><code>condition</code>：就是要满足的条件。</li>
</ul>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="4-2-使用实例"><a href="#4-2-使用实例" class="headerlink" title="4.2 使用实例"></a><font size=3>4.2 使用实例</font></h3><p>我们在一个上边已经插入了几条数据记录，并且设置了显示列的格式，我们可以在<code>SQLite</code>命令提示符后边输入以下语句类更新表中的数据：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; update stuinfo set name=&#x27;FANHUA&#x27;, age=19 where id=1001; -- 更新数据</span><br><span class="line">sqlite&gt; select * from stuinfo; -- 查看更新后的数据</span><br></pre></td></tr></table></figure>

<p>然后我们便会看到以下信息显示了：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score     </span><br><span class="line">----------  ----------  ----------  ----------</span><br><span class="line">1001        FANHUA      19          80.0      </span><br><span class="line">1002        qidaink                 90.0 </span><br></pre></td></tr></table></figure>

<p>这个时候就会发现数据已经更新完成了。</p>
<h2 id="5-DELETE"><a href="#5-DELETE" class="headerlink" title="5. DELETE"></a><font size=3>5. <code>DELETE</code></font></h2><h3 id="5-1-语句格式"><a href="#5-1-语句格式" class="headerlink" title="5.1 语句格式"></a><font size=3>5.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">DELETE FROM table_name WHERE [condition];</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于从 <code>SQLite</code> 数据库表中删除一条数据记录。可以使用带有 <code>WHERE</code> 子句的 <code>DELETE</code>查询来删除选定行，否则所有的记录都会被删除。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>DELETE</code>：这是一个关键字，表示删除数据。</li>
<li><code>table_name</code>：记录要删除数据所在数据表的名称。</li>
<li><code>WHERE</code>：是<code>SQLite</code>的子句，用于指定从一个表或多个表中获取数据的条件。</li>
<li><code>condition</code>：就是要满足的条件。</li>
</ul>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="5-2-使用实例"><a href="#5-2-使用实例" class="headerlink" title="5.2 使用实例"></a><font size=3>5.2 使用实例</font></h3><p>我们在一个上边已经插入了几条数据记录，也已经设置了显示格式，可以在<code>SQLite</code>命令提示符后边输入以下语句来删除表中的数据：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; delete from stuinfo where id=1001; -- 删除id为1001的数据</span><br><span class="line">sqlite&gt; select * from stuinfo; -- 查看更新后的数据</span><br></pre></td></tr></table></figure>

<p>然后我们便会看到以下信息显示了：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score     </span><br><span class="line">----------  ----------  ----------  ----------</span><br><span class="line">1002        qidaink                 90.0</span><br></pre></td></tr></table></figure>

<p>这个时候就会发现数据已经只剩下一条了，之前<code>id</code>为<code>1001</code>的数据已经被删除了。</p>
<h2 id="6-DROP"><a href="#6-DROP" class="headerlink" title="6. DROP"></a><font size=3>6. <code>DROP</code></font></h2><h3 id="6-1-语句格式"><a href="#6-1-语句格式" class="headerlink" title="6.1 语句格式"></a><font size=3>6.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">DROP TABLE table_name;</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong>该语句用于从 <code>SQLite</code> 数据库表中删除表定义及其所有相关数据、索引、触发器、约束和该表的权限规范。</p>
<p><strong>【语句参数】</strong></p>
<ul>
<li><code>DROP</code>：这是一个关键字，表示删除数据表。</li>
<li><code>table_name</code>：记录要删除数据表的名称。</li>
</ul>
<p><strong>【注意】</strong></p>
<p>（1）语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<p>（2）使用此命令时要特别注意，一旦一个表被删除，表中所有信息也将永远丢失。</p>
<h3 id="6-2-使用实例"><a href="#6-2-使用实例" class="headerlink" title="6.2 使用实例"></a><font size=3>6.2 使用实例</font></h3><p>我们在上边是创建了两个表，我们查看一下数据库中的数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .tables</span><br><span class="line">stuinfo  test</span><br></pre></td></tr></table></figure>

<p>我们在在<code>SQLite</code>命令提示符后边输入以下语句来删除一个数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; drop table test;</span><br></pre></td></tr></table></figure>

<p>然后我们重新查看这个数据库中所有的数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .tables</span><br><span class="line">stuinfo</span><br></pre></td></tr></table></figure>

<p>这个时候就会发现数据只剩下<code>stuinfo</code>了。</p>
<h2 id="7-ALTER"><a href="#7-ALTER" class="headerlink" title="7. ALTER"></a><font size=3>7. <code>ALTER</code></font></h2><h3 id="7-1-语句格式"><a href="#7-1-语句格式" class="headerlink" title="7.1 语句格式"></a><font size=3>7.1 语句格式</font></h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">ALTER TABLE table_name RENAME TO new_table_name; -- 重命名数据表</span><br><span class="line">ALTER TABLE table_name ADD COLUMN column_def...; -- 添加新列</span><br><span class="line">ALTER TABLE tablename DROP (columN); -- 删除一个字段</span><br></pre></td></tr></table></figure>

<p><strong>【语句说明】</strong><code>SQLite</code> 的 <code>ALTER TABLE</code> 命令不通过执行一个完整的转储和数据的重载来修改已有的表。我们可以使用 <code>ALTER TABLE</code> 语句重命名表，使用 <code>ALTER TABLE</code> 语句还可以在已有的表中添加额外的列。</p>
<p><strong>【语句参数】</strong>这个语句功能和形式较多，这里就不再写参数说明了，主要是通过实例来看。</p>
<p><strong>【注意】</strong>语句最后的分号（<code>;</code>）是语句结束的标志，不可缺少。</p>
<h3 id="7-2-使用实例"><a href="#7-2-使用实例" class="headerlink" title="7.2 使用实例"></a><font size=3>7.2 使用实例</font></h3><h4 id="7-2-1-重命名数据表"><a href="#7-2-1-重命名数据表" class="headerlink" title="7.2.1 重命名数据表"></a><font size=3>7.2.1 重命名数据表</font></h4><p>我们可以在<code>SQLite</code>命令提示符后边输入以下语句来重命名数据表：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; alter table stuinfo RENAME TO studentsInfo;</span><br></pre></td></tr></table></figure>

<p>然后我们通过<code>.tables</code>命令查看一下当前数据库中的数据表，便会看到以下信息显示了：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; .tables</span><br><span class="line">studentsInfo</span><br></pre></td></tr></table></figure>

<p>这个时候就会发现数据表名称已经被修改了，那数据是否还存在呢？我们使用以下命令来查看一下现在表中的数据：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">select * from studentsInfo; -- 查看重命名表之后表中的数据</span><br></pre></td></tr></table></figure>

<p>然后我们会看到以下信息：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score     </span><br><span class="line">----------  ----------  ----------  ----------</span><br><span class="line">1002        qidaink                 90.0</span><br></pre></td></tr></table></figure>

<p>这条信息就是上一步<code>DELETE</code>实例之后剩下的数据记录了。</p>
<h4 id="7-2-2-添加一个新列"><a href="#7-2-2-添加一个新列" class="headerlink" title="7.2.2 添加一个新列"></a><font size=3>7.2.2 添加一个新列</font></h4><p>我们可以在<code>SQLite</code>命令提示符后边输入以下语句来添加新列：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; alter table studentsInfo ADD COLUMN SEX char;</span><br></pre></td></tr></table></figure>

<p>我们使用以下命令来查看一下现在表中的数据：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlite&gt; select * from studentsInfo; -- 查看添加新列之后表中的数据</span><br></pre></td></tr></table></figure>

<p>然后我们会看到以下信息：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">id          name        age         score       SEX       </span><br><span class="line">----------  ----------  ----------  ----------  ----------</span><br><span class="line">1002        qidaink                 90.0                  </span><br></pre></td></tr></table></figure>

<p>由于我们只是赋值，所以这里是没有初始数据的，但是由于我们打开了表头显示，所以这里还是会显示这一新增的列。</p>

    </div>

    
    
    

    <footer class="post-footer">




    <div>
        
            <div style="text-align:center;color: #ccc;font-size:14px;">
            ----------本文结束
            <i class="fas fa-fan fa-spin" style="color: #FF1493; font-size: 1rem"></i>
            感谢您的阅读----------
            </div>
        
    </div>





  
  <div class="my_post_copyright"> 
    <p><span>文章标题:</span><a href="/post/6540bbef.html">LV07-03-SQLite-语句</a></p>
    <p><span>文章作者:</span><a href="/" title="欢迎访问 《苏木》 的学习笔记">苏木</a></p>
    <p><span>发布时间:</span>2023年07月03日 - 21:30</p>
    <p><span>最后更新:</span>2025年06月14日 - 00:25</p>
    <p><span>原始链接:</span><a href="/post/6540bbef.html" title="LV07-03-SQLite-语句">https://sumumm.github.io/post/6540bbef.html</a></p>
    <p><span>许可协议:</span><i class="fab fa-creative-commons"></i> <a rel="license" href= "https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
  </div>
  


          <div class="post-tags">
              <a href="/tags/LV07-SQLite/" rel="tag"><i class="fa fa-tag"></i> LV07-SQLite</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/d17b4c8b.html" rel="prev" title="LV07-04-SQLite-点命令">
                  <i class="fa fa-angle-left"></i> LV07-04-SQLite-点命令
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/aaf421eb.html" rel="next" title="LV07-02-SQLite-数据类型、运算符和表达式">
                  LV07-02-SQLite-数据类型、运算符和表达式 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 2017 – 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">苏木</span>
  </div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">3.7m</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">225:26</span>
  </span>
</div>




    <span id="sitetime"></span>
    <script defer language=javascript>
        function siteTime()
        {
            window.setTimeout("siteTime()", 1000);
            var seconds = 1000;
            var minutes = seconds * 60;
            var hours = minutes * 60;
            var days = hours * 24;
            var years = days * 365;
            var today = new Date();
            var todayYear = today.getFullYear();
            var todayMonth = today.getMonth()+1;
            var todayDate = today.getDate();
            var todayHour = today.getHours();
            var todayMinute = today.getMinutes();
            var todaySecond = today.getSeconds();
            /*==================================================
            Date.UTC() -- 返回date对象距世界标准时间(UTC)1970年1月1日午夜之间的毫秒数(时间戳)
            year        - 作为date对象的年份，为4位年份值
            month       - 0-11之间的整数，做为date对象的月份
            day         - 1-31之间的整数，做为date对象的天数
            hours       - 0(午夜24点)-23之间的整数，做为date对象的小时数
            minutes     - 0-59之间的整数，做为date对象的分钟数
            seconds     - 0-59之间的整数，做为date对象的秒数
            microseconds - 0-999之间的整数，做为date对象的毫秒数
            ==================================================*/
            var t1 = Date.UTC(2017, 
                              5, 
                              19, 
                              0, 
                              0, 
                              0); //北京时间
            var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
            var diff = t2-t1;
            var diffYears = Math.floor(diff/years);
            var diffDays = Math.floor((diff/days)-diffYears*365);
            var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
            var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
            var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
            document.getElementById("sitetime").innerHTML="已在这里 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒";
        }
        siteTime();
    </script>



    </div>
  </footer>

  
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.6.0/pjax.min.js" integrity="sha256-vxLn1tSKWD4dqbMRyv940UYw4sXgMtYcK6reefzZrao=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancyapps-ui/5.0.28/fancybox/fancybox.umd.js" integrity="sha256-ytMJGN3toR+a84u7g7NuHm91VIR06Q41kMWDr2pq7Zo=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.1/search.js" integrity="sha256-1kfA5uHPf65M5cphT2dvymhkuyHPQp5A53EGZOnOLmc=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>




  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>


  




  

  <script class="next-config" data-name="enableMath" type="application/json">true</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.js","integrity":"sha256-MASABpB4tYktI2Oitl4t+78w/lyA+D7b/s9GEP0JOGI="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


 
        <div id="click-show-text"
            data-mobile = false
            data-text = 富强,民主,文明,和谐,自由,平等,公正,法制,爱国,敬业,诚信,友善
            data-fontsize = 15px
            data-random= false>
        </div>
       

      
        <script async src=https://cdn.jsdelivr.net/npm/hexo-next-mouse-effect@latest/click/showText.js></script>
      

      
    




    <script async src="/js/fancybox_param.js"></script>





<!-- APlayer本体 -->



</body>
</html>
